﻿/**
 * 定义每个数据entity的结构和推荐显示方法
 * @type datacenter 
 */
normal.dataCenter = {
	category_reference: new Ext.data.SimpleStore(
		{
			fields:[
				{name:'id'},
				{name:'domain'},
				{name:'category'},
				{name:'identifier'},
				{name:'desc'},
				{name:'memo'},
				{name:'attached'}
			]
			,data:[
			['1','category','info-type ', 'inventory', '清单管理', '', ''],
			['2','category','info-type ', 'customer', '客户管理', '', ''],
			['3','category','info-type ', 'prompt', '优惠管理', '', '']
			]
		}
	),
	inventory: new ePOS.common.util.DataTemplate({
		name:'inventory',
		fields:[
			{name:'id',desc:'唯一标志',visible:false,editable:false,key:true,xtype:'NA'},
			{name:'name',desc:'名称',visible:true,editable:true,key:false,xtype:'textfield'},
			{name:'barcode',desc:'条形码',visible:true,editable:true,key:false,xtype:'textfield'},
			{name:'model',desc:'型号',visible:true,editable:true,key:false,xtype:'textfield'},
			{name:'category',desc:'类型',visible:true,editable:true,key:false,xtype:'textfield'},
			{name:'unit',desc:'单位',visible:true,editable:true,key:false,xtype:'textfield'},
			{name:'memo',desc:'备注',visible:true,editable:true,key:false,xtype:'textfield'}
		],
        DataObj:function(){
            this.id = 0;
            this.name = "";
            this.barcode = "";
            this.model = "";
            this.category = "";
            this.unit = "";
            this.memo = "";
        } 
	}),
	traderecord: new ePOS.common.util.DataTemplate({
		name:'traderecord',
		fields:[
			{name:'id',desc:'唯一标志',visible:false,editable:false,key:true,xtype:'NA'},
			{name:'transaction_no',desc:'交易编号',visible:true,editable:false,key:false,xtype:'NA'},
			{name:'begin_date',desc:'开始日期',visible:true,editable:true,key:false,xtype:'datefield'},
			{name:'begin_time',desc:'开始时间',visible:true,editable:true,key:false,xtype:'textfield'},
			{name:'end_date',desc:'结束日期',visible:true,editable:true,key:false,xtype:'datefield'},
			{name:'end_time',desc:'结束时间',visible:true,editable:true,key:false,xtype:'textfield'},
			{name:'operator_name',desc:'操作员',visible:true,editable:true,key:false,xtype:'textfield'},
			{name:'operator_loginname',desc:'操作员登录名',visible:false,editable:false,key:false,xtype:'textfield'},
			{name:'terminal',desc:'终端',visible:true,editable:true,key:false,xtype:'textfield'},
			{name:'cust_name',desc:'顾客',visible:true,editable:true,key:false,xtype:'textfield'},
			{name:'total_price',desc:'总价',visible:true,editable:true,key:false,xtype:'textfield'},
			{name:'memo',desc:'备注',visible:true,editable:true,key:false,xtype:'textfield'}
		],
        DataObj:function(){
            this.id = 0;
            this.transaction_no = "";
            this.begin_date = "";
            this.begin_time = "";
            this.end_date = "";
            this.end_time = "";
            this.operator_name = "";
            this.operator_loginname = "";
            this.terminal = "";
            this.cust_name = "";
            this.total_price = 0;
            this.memo = "";
        }  
	}),
	category: new ePOS.common.util.DataTemplate({
		name:'category',
		fields:[
			{name:'id',desc:'唯一标志',visible:false,editable:false,key:true,xtype:'NA'},
			{name:'entity_type',desc:'类型元数据',visible:true,editable:false,key:false,xtype:'textfield'},
			{name:'desc',desc:'描述',visible:true,editable:true,key:false,xtype:'textfield'},
			{name:'reference_data',desc:'引用数据',visible:true,editable:true,key:false,xtype:'textfield'},
			{name:'raw_code',desc:'代码',visible:true,editable:true,key:false,xtype:'textfield'},
			{name:'memo',desc:'备注',visible:true,editable:true,key:false,xtype:'textfield'}
		],
		DataObj:function(){
			this.id = 0;
			this.entity_type = "";
			this.desc = "";
			this.reference_data = "";
			this.raw_code = "";
			this.memo = "";
		}
	}),
    tradecontent: new ePOS.common.util.DataTemplate({
		name:'tradecontent',
		fields:[
			{name:'id',desc:'唯一标志',visible:false,editable:false,key:true,xtype:'NA'},
			{name:'trade_id',desc:'交易标识',visible:false,editable:false,key:false,xtype:'NA'},
			{name:'inv_id',desc:'商品标识',visible:false,editable:false,key:false,xtype:'NA'},
			{name:'inv_name',desc:'开始时间',visible:true,editable:true,key:false,xtype:'textfield'},
			{name:'act_price',desc:'成交价',visible:true,editable:true,key:false,xtype:'textfield'},
			{name:'decl_price',desc:'单价',visible:true,editable:true,key:false,xtype:'textfield'},
			{name:'num',desc:'数量',visible:true,editable:true,key:false,xtype:'textfield'},
			{name:'total_price',desc:'总价',visible:true,editable:true,key:false,xtype:'textfield'},
			{name:'memo',desc:'备注',visible:true,editable:true,key:false,xtype:'textfield'}
		]
	})
};